home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 February / PCWorld_2007-02_cd.bin / v cisle / mcvirtual / Virtual PC 2004 SP1.exe / Virtual PC 2004 SP1 / Microsoft Virtual PC 2004 MSDN.msi / JAPANESE_VPCHELP / shared.js < prev    next >
Text File  |  2004-06-15  |  74KB  |  1,961 lines

  1. // Filename: shared.js
  2. // Version shared.js for Windows Server Family
  3. // version for 2.2.4
  4.  
  5. //************************************************ Shared components path setting *****************************************
  6. //*******************************************************************************************************************
  7. //    Date   03/21/2003
  8. //  
  9.  
  10. set_path = "" + document.URL
  11. ntshared = set_path.indexOf("::/")
  12.  
  13. if (ntshared == -1) {
  14.     var moniker= "ms-its:";                  
  15.     var sSharedCHM = moniker+"VPC.chm::/";         
  16.     }                                                    
  17. else
  18.     {
  19.     path = set_path.substring(0,ntshared)
  20.     path = path.toLowerCase()
  21.     ntshared = path.lastIndexOf("\\")
  22.     var moniker = path.substring(0,ntshared)+ "\\";
  23.     //var ntshared = moniker.lastIndexOf("\\")
  24.     //var moniker = moniker.substring(0,ntshared) + "\\";
  25.     var sSharedCHM= moniker+"VPC.chm::/";
  26.     }
  27.  
  28.  
  29.  
  30.  
  31. //************************************************ EVENT HANDLING ********************************************
  32. //*******************************************************************************************************************
  33. //  re-directs to the proper event-driven functions.
  34.  
  35. // window.onload = load_object;
  36. window.onload = loadPage;
  37. document.onclick= onclickTriage;
  38. document.onmouseover= gettingHot;
  39. document.onmouseout= gettingCold;
  40. window.onunload=saveChecklistState;
  41. window.onresize= resizeDiv;
  42.  
  43. window.onbeforeprint = set_to_print;
  44. window.onafterprint = reset_form;
  45.         
  46. //********************************************  USER-DEFINED GLOBAL VARIABLES  ************************************
  47. //********************************************************************************************************************
  48. //  The images listed below can all be changed by the user.
  49. var isIE5 = (navigator.appVersion.indexOf("MSIE 5")>0) || (navigator.appVersion.indexOf("MSIE")>0 && parseInt(navigator.appVersion)> 4);
  50. var isIE55 = (navigator.appVersion.indexOf("MSIE 5.5")>0);
  51. if (isIE5 && isIE55) isIE5 = false;
  52. var isIE6 = (navigator.appVersion.indexOf("MSIE 6")>0);
  53. var isIE4 = (navigator.appVersion.indexOf("MSIE 4")>0);
  54.  
  55. if (isIE4){
  56.     var moniker= "ms-its:";                                         // moniker= ""; for flat files
  57.     var sSharedCHM= moniker+"ntshared.chm::/";
  58. }
  59.  
  60.  
  61. if (!isIE5 && !isIE55 && !isIE4 && !isIE6) {
  62.     isIE6 = true;
  63.     }
  64.  
  65.  
  66. var sShortcutTip= "";
  67.  
  68. var gifwithin = false;
  69.  
  70.  
  71.  
  72. if(!isIE4){
  73.     xmldoc = new ActiveXObject("microsoft.XMLDOM");
  74.     xmldoc.async = false;
  75.     xmldoc.load(sSharedCHM + "alttext.xml");
  76.  
  77.     var Alt_sPreviousTip= xmldoc.getElementsByTagName("sPreviousTip")
  78.     var Alt_sNextTip= xmldoc.getElementsByTagName("sNextTip")
  79.     var Alt_sExpandTip= xmldoc.getElementsByTagName("sExpandTip")
  80.     var Alt_sPopupTip= xmldoc.getElementsByTagName("sPopupTip")
  81.     var hld_path2reuse= xmldoc.getElementsByTagName("path2reuse")
  82.     var hld_path2glossary= xmldoc.getElementsByTagName("path2glossary")
  83.     var hld_rel_gif = xmldoc.getElementsByTagName("reltopgif")
  84.     var hld_chmName = xmldoc.getElementsByTagName("chmName")
  85.     var hld_emailer = xmldoc.getElementsByTagName("emailer")
  86.     var hld_sendtext = xmldoc.getElementsByTagName("sendtext")
  87.     var hld_sendto = xmldoc.getElementsByTagName("sendto")
  88.     var hld_prelimtext = xmldoc.getElementsByTagName("prelimtext")
  89.     var hld_prelimyesno = xmldoc.getElementsByTagName("prelimyesno")
  90.     //<SMARTHELP>
  91.  
  92.    var defaultStartMode;
  93.    var defaultCPanelMode;
  94.    var smartErrorTextNode;
  95.    var smartErrorText;
  96.    var xmldocSKUSettings;
  97.  
  98.    // Grab the ALTTEXT.XML enteries for smart span classes.
  99.    // Get SKU specific defaults.
  100.    var defaultSKUSettingsURL = xmldoc.documentElement.selectSingleNode("smartreusabletext");
  101.    if (defaultSKUSettingsURL != null) {
  102.       if (defaultSKUSettingsURL.text == sSharedCHM + "alttext.xml") {
  103.           xmldocSKUSettings = xmldoc;
  104.       } else {
  105.          xmldocSKUSettings = new ActiveXObject("microsoft.XMLDOM");
  106.          xmldocSKUSettings.async = false;
  107.          xmldocSKUSettings.load(moniker + defaultSKUSettingsURL.text);
  108.       }
  109.       if (xmldocSKUSettings.documentElement != null) {
  110.          defaultStartMode = xmldocSKUSettings.documentElement.selectSingleNode("smartstartdefault");
  111.          defaultCPanelMode = xmldocSKUSettings.documentElement.selectSingleNode("smartcpaneldefault");
  112.          smartErrorTextNode = xmldocSKUSettings.documentElement.selectSingleNode("smarterrortext");
  113.          smartErrorText = smartErrorTextNode ? smartErrorTextNode.text : "XOXOX";
  114.       }
  115.    } // (defaultSKUSettingsURL != NULL)
  116.  
  117. //</SMARTHELP>
  118.  
  119.     
  120.     var sPreviousTip="" + Alt_sPreviousTip.item(0).nodeTypedValue
  121.     var sNextTip="" + Alt_sNextTip.item(0).nodeTypedValue
  122.     var sExpandTip="" + Alt_sExpandTip.item(0).nodeTypedValue
  123.     var sPopupTip="" + Alt_sPopupTip.item(0).nodeTypedValue
  124.     var path2reuse="" + hld_path2reuse.item(0).nodeTypedValue
  125.     var path2glossary="" + hld_path2glossary.item(0).nodeTypedValue
  126.     var rel_gif="" + hld_rel_gif.item(0).nodeTypedValue
  127.     var chmName="" + hld_chmName.item(0).nodeTypedValue+"::/"
  128.     var emailer="" + hld_emailer.item(0).nodeTypedValue
  129.     var sendtext="" + hld_sendtext.item(0).nodeTypedValue
  130.     var sendto="" + hld_sendto.item(0).nodeTypedValue
  131.     var prelimtext="" + hld_prelimtext.item(0).nodeTypedValue
  132.     var prelimyesno="" + hld_prelimyesno.item(0).nodeTypedValue
  133.  
  134. var xmldom = new ActiveXObject("microsoft.XMLDOM");
  135.     xmldom.async = false;
  136.     
  137. //if (!xmlLoaded) {
  138.  
  139.             xmldoc = new ActiveXObject("microsoft.XMLDOM");
  140.  
  141.             // Init Properties
  142.             xmldoc.async = false;
  143.             xmldoc.validateOnParse = false; // improve perf
  144.             xmldoc.resolveExternals = false;
  145.             xmldoc.preserveWhiteSpace = false;
  146.  
  147.             // Load Document
  148.             xmldoc.load(moniker + path2reuse + "reusable.xml");
  149.             // if (xmldoc == null || xmldoc.documentElement == null) return;     // couldn't open reusable.xml
  150.             xmlLoaded = true;
  151. //         }
  152.  
  153. } // skip all this because ie4 doesn't support xml.
  154. else
  155. {
  156. var sPreviousTip="" 
  157.     var sNextTip=""
  158.     var sExpandTip=""
  159.     var sPopupTip=""
  160.     var rel_gif="no"
  161. }
  162.  
  163. var closed = sSharedCHM + "plusCold.gif";            //image used for collapsed item in callExpand()
  164. var closedHot = sSharedCHM + "plusHot.gif";            //hot image used for collapsed item in callExpand()
  165. var expand = sSharedCHM + "minusCold.gif";            //image used for expanded item in callExpand()
  166. var expandHot = sSharedCHM + "minusHot.gif";        //hot image used for expanded item in callExpand()
  167.  
  168. var previousCold= sSharedCHM + "previousCold.gif";
  169. var previousHot= sSharedCHM + "previousHot.gif"; 
  170. var nextCold= sSharedCHM + "nextCold.gif";
  171. var nextHot= sSharedCHM + "nextHot.gif"; 
  172.  
  173. var shortcutCold= sSharedCHM + "shortcutCold.gif";
  174. var shortcutHot= sSharedCHM + "shortcutHot.gif";
  175.  
  176. var popupCold= sSharedCHM + "popupCold.gif";
  177. var popupHot= sSharedCHM + "popupHot.gif";
  178.  
  179. var emptyImg= sSharedCHM + "empty.gif";        //image used for empty expand
  180. var noteImg= sSharedCHM + "note.gif";            //image used for notes
  181. var tipImg= sSharedCHM + "tip.gif";            //image used for tips
  182. var warningImg= sSharedCHM + "warning.gif";        //image used for warnings
  183. var cautionImg= sSharedCHM + "caution.gif";        //image used for cautions
  184. var importantImg= sSharedCHM + "important.gif";        //image used for important notice
  185. var relTopicsImg= sSharedCHM + "rel_top.gif";        //image used for important notice
  186.  
  187. var branchImg= sSharedCHM + "elle.gif";
  188. var branchImg_RTL= sSharedCHM + "elle_rtl.gif";
  189.  
  190.  
  191. //********************************************  GLOBAL VARIABLES  ******************************************
  192. //********************************************************************************************************
  193.  
  194. var joejoe = false;
  195. var printing = false;
  196. var single = "FALSE";
  197. var scroller = "FALSE";
  198. var valet = "FALSE";
  199. var isRTL= (document.dir=="rtl");
  200. var imgStyleRTL= ""; 
  201.       if (isRTL) imgStyleRTL=" style='filter:flipH' ";
  202.  
  203. var sActX_TDC= "CLASSID='CLSID:333C7BC4-460F-11D0-BC04-0080C7055A83'";        //Tabular Data Control  for  reusable text data
  204. var sSharedReusableTextFile= sSharedCHM + "reusable.xml";                                        // common reusable text file
  205. var sSharedReusableTextFileRecord= "para";                                                        //reusable text record
  206.  
  207. var numbers= /\d/g;                //javascript regular expression
  208. var spaces= /\s/g;                //javascript regular expression
  209. var semicolon= /;/g;            //javascript regular expression
  210.  
  211. var isPersistent= false;
  212.  
  213.  
  214.  
  215.     
  216. //********************************************  INITIALIZATION  *************************************************
  217. //******************************************************************************************************************
  218. function list_them(){
  219.         
  220.     var envelope = sSharedCHM +'envelope.gif';
  221.     var server = "<DIV Class='FeedbackBar'><SPAN Class='webOnly'><IMG  SRC=" + envelope + " ALT='' BORDER='0'></SPAN><SPAN Class='webOnly' Style='position:relative; top:-1; left:1; color:#333333;'> " + sendtext + " "; 
  222.     server += "<a href='mailto:" + sendto + "?subject=HELP: ";
  223.     server += document.title + "'";
  224.     server += ">" + sendto + "</a></SPAN></DIV>";
  225.     
  226.     var i;
  227.  
  228.     for (i=0; i < document.all.length; i++){
  229.         if ((document.all[i].tagName == "P") ||
  230.             (document.all[i].tagName == "H1")||
  231.             (document.all[i].tagName == "H6")){
  232.             document.all[i].outerHTML = server + document.all[i].outerHTML;
  233.             i = document.all.length;
  234.             }
  235.         }
  236. }
  237. //********************************************  Preminiary Text insertion function  *************************************************
  238. //******************************************************************************************************************
  239. function prelim(){
  240.     var server = "<DIV Class='FeedbackBar'style='width:88%'><SPAN Style='position:relative; top:-1; left:1; color:#333333; font:90%'>" + prelimtext; 
  241.     server += "</SPAN></DIV>";
  242.     
  243.     var i;
  244.  
  245.     for (i=0; i < document.all.length; i++){
  246.         if ((document.all[i].tagName == "P") ||
  247.             (document.all[i].tagName == "H1")||
  248.             (document.all[i].tagName == "H6")){
  249.             document.all[i].outerHTML = server + document.all[i].outerHTML;
  250.             i = document.all.length;
  251.             }
  252.         }
  253. }
  254. //*** loadPage **********************************************************************************************
  255. //  Adds the default image tags and re-usable text to the HTML page.
  256.  
  257. function loadPage(){
  258. if (printing == true) return;
  259.  
  260. if (emailer == "yes" ) list_them();
  261. if (prelimyesno == "yes" ) prelim();
  262. isPersistent= (document.all.item("checklist")!=null) && ((isIE5) || (isIE55) ||(isIE6));
  263.  
  264.   setPreviousNext();
  265.   
  266.   resizeDiv();
  267.   if (isPersistent) getChecklistState();
  268.    
  269.      load_object();
  270.     addReusableText();
  271.     
  272.     insertImages();
  273. }
  274.  
  275. //****** setPreviousNext  ************************************************************************ ********************************************************************************************* 
  276. // insert previous/next navbar
  277. // called by: <div id="nav">@@HTMLsequenceFile.txt or .lst@@</div>
  278.  
  279. function setPreviousNext(){
  280.  
  281.   var oNav = document.all.item("nav");
  282.         if (oNav == null ) return;
  283.   
  284.   var sPreviousALT= sPreviousTip;
  285.   var sNextALT= sNextTip;
  286.   var sHTMLfile= oNav.innerHTML;
  287.  
  288.   var imgPrev= "<IMG SRC='"+previousCold+"' BORDER=0 ALT='"+ sPreviousALT +"' ALIGN='top' "+ imgStyleRTL +">";
  289.   var imgNext= "<IMG SRC='"+nextCold+"' BORDER=0 ALT='"+ sNextALT  + "' ALIGN='top' "+ imgStyleRTL +">";
  290.   
  291.   var previousNextObject= "<OBJECT ID='HTMlist' WIDTH=100 HEIGHT=51 " + sActX_TDC +"><param name='DataURL' value='"
  292.         +sHTMLfile +"'><param name='UseHeader' value=True></OBJECT>";
  293.       
  294.         oNav.innerHTML= "<TABLE WIDTH='100%' STYLE='margin-top:0;' cellspacing=0>"
  295.         + "<TR><TD style='text-align=left; background-color:transparent'><A ID='previousLink' HREF='#' REL='previous' CLASS='navbar'>"
  296.         +imgPrev + "</A></TD><TD width='100%' align='center'></td><TD style='text-align=right; background-color:transparent'><A ID='nextLink' HREF='#' REL='next' CLASS='navbar'>"
  297.         +imgNext+ "</A></TD></TR></TABLE>";
  298.                     
  299.       document.body.innerHTML= document.body.innerHTML +  previousNextObject;
  300.       findPageSeq();
  301.       if (printing == true) return;
  302.       var  thisLoc= document.location.href +"#";
  303.  
  304.       if (previousLink.href== thisLoc) previousLink.style.display="none";
  305.       else  previousLink.style.display="block";
  306.  
  307.       if (nextLink.href== thisLoc) nextLink.style.display="none";
  308.       else  nextLink.style.display="block";
  309.       
  310. }
  311.  
  312. function findPageSeq() {
  313.  
  314. var rs= HTMlist.recordset;
  315. var thisLoc= document.location.href;
  316. var iLoc= thisLoc.lastIndexOf("/");
  317.  
  318.     if (iLoc > 0) thisLoc= thisLoc.substring(iLoc+1, thisLoc.length);
  319.     
  320.     
  321.     if (nav.style == "[object]") {
  322.                 nav.style.visibility="hidden";
  323.                 printing = false;
  324.                 }
  325.         else
  326.             {
  327.                 printing = true;
  328.                 return;
  329.             }
  330.     
  331.        
  332.     rs.moveFirst();
  333.        
  334.     while (!rs.EOF) {
  335.           if (thisLoc == rs.fields("HTMfiles").value){
  336.               nav.style.visibility="visible"; 
  337.                 rs.MoveNext();
  338.               break;
  339.           }
  340.           previousLink.href=rs.fields("HTMfiles").value;      
  341.           rs.moveNext();
  342.      }
  343.                 
  344.       if (!rs.EOF) nextLink.href=rs.fields("HTMfiles").value;
  345. }
  346.     
  347. //******Re-usable text ********************************************************************************************* 
  348. // Inserts the Tabular Data Control (TDC) object at the end of the page 
  349. // Inserts "re-usable text" from the txt file at: <span id="@@CHM_name@@@@index#@@" class="reuse"></span>
  350. // e.g.<span id="printing4" class="reuse"></span> for record#4 in the printing.txt in printing.chm.
  351.  
  352. // <SMARTREUSABLETEXT>
  353.  
  354. // addReusableText() - called during document load to find all references
  355. // render time bound <SPAN> contents.  Extracts content resources from reusable.xml.
  356. //
  357. // "class" names bound (reuse, smart)
  358. // "reuse" static lookup of commonly referred to text.
  359. // "smart" dynamic lookup of navigation text relevent 
  360. //         to the shell presentation of the start menu 
  361. //         and the control panel, (simple and classic), for the logged on user.
  362. //         Requires inserting custom <OBJECT> supported by Help and Support Services viewer.
  363. //         Currently not available from HTML Help control. 2000/01/12.
  364. //
  365. function smarthelperror(){
  366.     // alert("error - error")
  367.     addReusableText();
  368.     
  369.     insertImages();
  370.     return true;
  371.     // alert("error - error")
  372.     }
  373.  
  374. //var obj = window.document.createElement("OBJECT");
  375.     
  376. function load_object(){
  377.             if(!isIE6) return;
  378.             
  379.             //window.onerror = smarthelperror;
  380.         try{
  381.             var obj = window.document.createElement("OBJECT");
  382.             var sActX_PCHealth = "CLSID:FC7D9E02-3F9E-11d3-93C0-00C04F72DAF7";
  383.            objLoaded = true;    
  384.            obj.width = 1;
  385.            obj.height = 1;
  386.         
  387.            obj = document.body.insertAdjacentElement("beforeEnd", obj)
  388.            obj.id = "pchealth";
  389.            obj.classid = sActX_PCHealth;
  390.           // alert("success")
  391.           }
  392.         catch(e){}
  393.        }
  394.  
  395. function addReusableText(){
  396.     if (isIE4) return;    // no reusable text for IE4
  397.    var coll = document.all.tags("SPAN");
  398.    var xmlLoaded = false;
  399.    var control = null;
  400.    var thisID;
  401.    var strKey;
  402.    var text;
  403.  
  404.    // original error text
  405.    text = "OXO";
  406.  
  407.    //<SMARTREUSABLETEXT>
  408.    //queried state of shell presentation for start menu and control panel.
  409.    var menuSimple = false;
  410.    var controlSimple = false;
  411.  
  412.    // holds calculated lookup suffixes for smart class items.
  413.    var strSuffixStartMenuOnly = "";
  414.    var strSuffixStartMenuAndControlPanel = "";
  415.  
  416.    // smart class UserSettings Interface classid
  417.    var sActX_PCHealth = "CLSID:FC7D9E02-3F9E-11d3-93C0-00C04F72DAF7";
  418.  
  419.    // smart class lookup suffixes per shell presentation mode.
  420.    // TODO: Findout where these constants are best documented.
  421.    var strMenuClassic =   "_smclassic";
  422.    var strMenuSimple =    "_smsimple";
  423.    var strCPanelClassic = "_cpclassic";
  424.    var strCPanelSimple =  "_cpsimple";
  425.  
  426.    // only attempt to query once per rendering
  427.    var bPresentationModeQueried = false;
  428.    //</SMARTREUSABLETEXT>
  429.     span_count = coll.length;
  430.    // Check every span in the document.
  431.    for (var i=0; i< span_count; i++) {
  432.     
  433.       var thisSpan = coll[i];
  434.       var spanClass = thisSpan.className.toLowerCase();
  435.       if (spanClass == "reuse" || spanClass == "smart") {
  436.          if (isRTL) thisSpan.dir = "rtl";
  437.          if (thisSpan.id == null) break;
  438.  
  439.          // strKey is the key we'll use to look up the replaceable text in the XML file
  440.          strKey = thisSpan.id.toLowerCase();
  441.          
  442.         
  443.            
  444.          // skip smart tags when defaults are not present
  445.          if ((defaultSKUSettingsURL != null) && (xmldocSKUSettings.documentElement != null)) {
  446.             if (spanClass == "smart") {
  447.              
  448.                // Query Presentation Mode once per rendering.
  449.                if (!bPresentationModeQueried) {
  450.                 
  451.                   bPresentationModeQueried=true;
  452.  
  453.                   // Set To Defaults
  454.                   if (defaultStartMode != null) {
  455.                      menuSimple = (defaultStartMode.text == strMenuSimple);
  456.                   } else {
  457.                      menuSimple = true;
  458.                   }
  459.  
  460.                   if (defaultCPanelMode != null) {
  461.                      controlSimple = (defaultCPanelMode.text == strCPanelSimple);
  462.                   } else {
  463.                      controlSimple = true;
  464.                   }
  465.                        
  466.                   
  467.                     
  468.                  // alert("inside of reuse")
  469.  
  470.                   // Get the current user's presentation settings
  471.                   // Attempt to read smart help values from system
  472.                   var test = window.document.all("pchealth");
  473.                   
  474.                   if (test != null) {
  475.                       
  476.                      if (test.UserSettings != null) {                        
  477.                           
  478.                    
  479.                             menuSimple = test.UserSettings.IsStartPanelOn;
  480.                     
  481.                             controlSimple = test.UserSettings.IsWebViewBarricadeOn;
  482.                                                 
  483.                         
  484.                      }
  485.                      else
  486.                      {
  487.                          menuSimple = (defaultStartMode.text == strMenuSimple)
  488.                         controlSimple = (defaultCPanelMode.text == strCPanelSimple);
  489.                     }
  490.                              
  491.                          
  492.                     
  493.                         
  494.                  }// (test != null)
  495.  
  496.               }// (!bPresentationModeQueried)
  497.  
  498.               // get the error text to display
  499.               text = smartErrorText;
  500.  
  501.               // Build key suffixes. One for start menu only and one for start menu and control panel.
  502.               strSuffixStartMenuOnly = (menuSimple ? strMenuSimple : strMenuClassic);
  503.               strSuffixStartMenuAndControlPanel = strSuffixStartMenuOnly + (controlSimple ? strCPanelSimple : strCPanelClassic);
  504.  
  505.               // The actual key could have either strSuffixStartMenuOnly or strSuffixStartMenuAndControlPanel suffixes.
  506.               // strSuffixStartMenuAndControlPanel has precedence over strSuffixStartMenuOnly
  507.               strKey = strKey + strSuffixStartMenuAndControlPanel;
  508.                 //alert(strKey)
  509.             }//if (spanClass == "smart")
  510.  
  511.          }// ((defaultSKUSettingsURL != null) && (xmldocSKUSettings.documentElement != null))
  512.  
  513.          // Lookup XML node containing reference
  514.  
  515.          var strNodeSelector = "glossSection/entry[@entryID='" + strKey + "']/scopeDef/def";
  516.          var node = xmldoc.documentElement.selectSingleNode(strNodeSelector);
  517.  
  518.          // if we haven't found the node yet, try the other suffix if this is a smart span
  519.          if (node == null && spanClass == "smart" && (defaultSKUSettingsURL != null) && (xmldocSKUSettings.documentElement != null)) {
  520.             // one more try--use the other suffix
  521.             strKey = thisSpan.id.toLowerCase() + strSuffixStartMenuOnly;
  522.             strNodeSelector = "glossSection/entry[@entryID='" + strKey + "']/scopeDef/def";
  523.             node = xmldoc.documentElement.selectSingleNode(strNodeSelector);
  524.          }
  525.  
  526.         // okay, we found the node, get the text
  527.          // alert(coll.length)
  528.          if (node != null) {
  529.             // replace the span's contents with the reusable text
  530.             thisSpan.insertAdjacentHTML("BeforeBegin",node.text);
  531.             // var coll = document.all.tags("SPAN");
  532.             thisSpan.className = "anything"
  533.             thisSpan.innerHTML = "";
  534.             //alert(node.text)
  535.              //thisSpan.innerHTML = node.text;
  536.          } else {
  537.                  // error shown by this  OXO
  538.                thisSpan.innerHTML = text;
  539.          }
  540.         
  541.       } // if (spanClass == "reuse" || spanClass == "smart")
  542.    }// for
  543.  
  544. }// addReusableText()
  545. // <SMARTREUSABLETEXT>
  546.  
  547.  
  548. //****** insertImages ********************************************************************************************* 
  549. //  Inserts shared images in User-Defined Variables section and thumbnails.
  550. var booking = false;
  551. function insertImages(){
  552.  
  553. if (printing == false) booking = true;
  554. if (printing == true && booking == true ) {
  555.     booking = false;
  556.     return;
  557.     }
  558. // insert alert icons
  559.   var collP = document.all.tags("P");
  560.   
  561.   for (var i=0; i<collP.length; i++) {
  562.        if (collP[i].className.toLowerCase()=="note")            collP[i].innerHTML ="<img class='alert' src='"+noteImg+"' "+ imgStyleRTL +"> " +     collP[i].innerHTML;
  563.        else if (collP[i].className.toLowerCase()=="warning")    collP[i].innerHTML ="<img class='alert' src='"+warningImg+"'> " +  collP[i].innerHTML;
  564.        else if (collP[i].className.toLowerCase()=="caution")    collP[i].innerHTML ="<img class='alert' src='"+cautionImg+"'> " +  collP[i].innerHTML;
  565.        else if (collP[i].className.toLowerCase()=="tip")        collP[i].innerHTML ="<img class='alert' src='"+tipImg+"'> " +      collP[i].innerHTML;
  566.        else if (collP[i].className.toLowerCase()=="important")  collP[i].innerHTML ="<img class='alert' src='"+importantImg+"'> " + collP[i].innerHTML;
  567.        else if (collP[i].className.toLowerCase()=="empty")      collP[i].innerHTML ="<img class='alert' src='"+emptyImg+"'> " +    collP[i].innerHTML;
  568.        if (collP[i].className.toLowerCase()=="reltopics" && rel_gif == "yes")  {
  569.             collP[i].outerHTML ="<img class='relTopics' src='"+relTopicsImg+"'> " + collP[i].outerHTML;
  570.             }   
  571.           }
  572.   
  573. //alert(printing)
  574. //alert(isIE55)
  575. //indents for Navigation Tree 
  576. var collUL = document.all.tags("UL");
  577. if (!printing) {
  578. for (var i=0; i<collUL.length; i++) {
  579.        var indent= 0;
  580.        if (collUL[i].className.toLowerCase()=="navtree"){
  581.            if (isRTL) collUL[i].style.listStyleImage= "url('" + branchImg_RTL + "')";
  582.            else collUL[i].style.listStyleImage= "url('" + branchImg + "')";
  583.              for (var j = 0; j < collUL[i].children.length; j++)
  584.                 if (collUL[i].children[j].className.toLowerCase()=="branch"){
  585.                     if (isRTL) collUL[i].children[j].style.marginRight= (indent +'em');
  586.                     else   collUL[i].children[j].style.marginLeft= (indent +'em');
  587.                     indent= indent + 0.75;
  588.                 }
  589.       }
  590. }
  591. }
  592.    
  593.   for (var i=0; i < document.anchors.length; i++){
  594.          var imgInsert="";  
  595.          var imgStyle= "";
  596.          var imgSpace= "<span class='space'></span>";      
  597.          var oBefore=document.anchors[i].parentElement.tagName;
  598.          var oAnchor= document.anchors[i].id.toLowerCase();
  599.          
  600. // insert RELTOPICS icons
  601.     if (rel_gif == "yes"){
  602.        if (oAnchor=="reltopics")
  603.                if (document.anchors[i].children.tags("IMG")(0) && document.anchors[i].children.tags("IMG")(0).className.toLowerCase() == "reltopics")
  604.                     imgInsert= "";    // not to re-insert when persistent
  605.             else  imgInsert= "<img class='relTopics' src='"+relTopicsImg+"'>" + imgSpace;
  606.         }
  607.         
  608. // insert SHORTCUT icons
  609.        if (oAnchor=="shortcut") {    
  610.             document.anchors[i].title= sShortcutTip;     
  611.             if (document.anchors[i].children.tags("IMG")(0) && document.anchors[i].children.tags("IMG")(0).className.toLowerCase() == "shortcut")
  612.                     imgInsert= "";    // not to re-insert when persistent
  613.             else  imgInsert= "<img class='shortcut' src='"+shortcutCold+"' "+ imgStyleRTL+ ">" + imgSpace;
  614.         }    
  615.                       
  616. // insert POPUP icons
  617.        else if (oAnchor=="wpopup" || oAnchor=="wpopupweb") document.anchors[i].title= sPopupTip;
  618.        else if (document.anchors[i].className.toLowerCase()=="popupicon")
  619.             if (document.anchors[i].children.tags("IMG")(0) && document.anchors[i].children.tags("IMG")(0).className.toLowerCase() == "popup")
  620.                    imgInsert= "";    // not to re-insert when persistent
  621.             else imgInsert= "<img class='popup' src='"+popupCold+"'>" + imgSpace;
  622.  
  623. // insert EXPAND icons 
  624.        else if (oAnchor=="expand") {
  625.               document.anchors[i].title= sExpandTip;
  626.               if (document.anchors[i].children.tags("IMG")(0) && document.anchors[i].children.tags("IMG")(0).className.toLowerCase() == "expand")
  627.                   imgInsert= "";     // not to re-insert when persistent      
  628.               else{ 
  629.                   if (document.anchors[i].parentElement.offsetLeft == document.anchors[i].offsetLeft) {
  630.                       imgSpace= "<span class='space' style='width:0'></span>";     
  631.                       if (isRTL){ document.anchors[i].parentElement.style.marginRight= "1.5em";  imgStyle=" style=margin-right:'-1.5em'";}
  632.                       else { document.anchors[i].parentElement.style.marginLeft= "1.5em";  imgStyle=" style=margin-left:'-1.5em'";}
  633.                   }      
  634.                   imgInsert= "<img class='expand' src='"+ closed +"' "+imgStyle+">" +imgSpace;
  635.               }
  636.        }
  637.  
  638.  
  639.  
  640. // insert thumbnail images       
  641.        else if (oAnchor=="thumbnail"  || oAnchor=="thumbnailweb"){ 
  642.             var sAltText = document.anchors[i].innerHTML;
  643.             gifwithin = true;
  644.             var sThumbnailText = document.anchors[i].title; 
  645.             var oImg = document.anchors[i].href.toLowerCase();
  646.                   if (oAnchor=="thumbnail") 
  647.                          var sThumbnailImg= moniker + getURL(oImg);
  648.                   else var sThumbnailImg = document.anchors[i].href.toLowerCase();
  649.                   
  650.                  found = sAltText.indexOf("BACKGROUND-COLOR:")
  651.             if (found != -1) {
  652.                 stop_p = sAltText.indexOf(">");
  653.                 sAltText = sAltText.substring(stop_p + 1, sAltText.length);
  654.                 stop_p = sAltText.indexOf("</FONT>");
  655.                 Highlighted = sAltText.substring(0,stop_p)
  656.                 sAltText = Highlighted + sAltText.substring(stop_p + 7, sAltText.length);
  657.                 }
  658.  
  659.                   
  660.                 document.anchors[i].outerHTML = "<DIV id='thumbDiv' class='thumbnail'>"+document.anchors[i].outerHTML+"</div>";
  661.                 document.anchors[i].innerHTML = "<img class='thumbnail' src='" + sThumbnailImg + "' alt= ' " + sAltText + "'><p>" +sThumbnailText+"</p>";
  662.                 
  663.                   if (isRTL) thumbDiv.style.styleFloat= "right";
  664.            }
  665.            
  666.         
  667.         
  668.         document.anchors[i].innerHTML = imgInsert + document.anchors[i].innerHTML;
  669.        if (isRTL) document.anchors[i].dir="rtl";
  670.    }
  671. }
  672.  
  673.  
  674.  
  675. //***** onclickTriage ****************************************************************************************
  676. // redirects to the appropriate function based on the ID of the clicked <A> tag.
  677.  
  678. function onclickTriage(){
  679. var e= window.event.srcElement;
  680.  
  681. //  if the innerHTML in the <a> tag is encapsulated by a style tag or hightlighted in the word seach,
  682. //  the parentElement is called.
  683.  
  684.     if ((isIE55 || isIE6) && printing == true) {
  685.         printing = false;
  686.         reset_form();
  687.         }
  688.         
  689.     for (var i=0; i < 5; i++)
  690.            if (e.tagName!="A" && e.parentElement!=null) e= e.parentElement;
  691.     eID= e.id.toLowerCase();
  692.                 
  693.     if (popupOpen) closePopup();
  694.     
  695. // expand image in a new window
  696.     if (eID=="thumbnail" || eID=="pophtm") popNewWindow(e);
  697.     else if (eID=="thumbnailweb") callThumbnailWeb(e);
  698.     else if (eID=="wpopup")    callPopup(e);
  699.     else if (eID=="wpopupweb") callPopupWeb(e);
  700.     else if (eID=="shortcut")  callShortcut(e);
  701.     else if (eID=="reltopics") callRelatedTopics(e);
  702.     else if (eID=="altloc")    callAltLocation(e);
  703.     else if (eID=="expand")    callExpand(e);
  704. // added to support Randy's Quad method code
  705.     else QuadDocumentClick()
  706. // ******************************
  707. }
  708.  
  709.  
  710. //*** gettingHot ****************************************************************************************
  711. // Makes all the required changes for mouseover.
  712.  
  713. function gettingHot() {
  714. var e = window.event.srcElement;
  715.     
  716.  
  717.  
  718.   if (e.id.toLowerCase()=="cold")  e.id ="hot";
  719.   else if (e.src== previousCold)  e.src = previousHot;
  720.   else if (e.className.toLowerCase()=="navbar" && e.children.tags("IMG")(0).src== previousCold)  e.children.tags("IMG")(0).src= previousHot;
  721.   else if (e.src== nextCold)  e.src = nextHot;
  722.   else if (e.className.toLowerCase()=="navbar" && e.children.tags("IMG")(0).src== nextCold)  e.children.tags("IMG")(0).src= nextHot;
  723.   
  724.   else if (e.className.toLowerCase()=="shortcut" && e.tagName=="IMG")  e.src = shortcutHot;            //<img> tags have a class
  725.   else if (e.id.toLowerCase()=="shortcut")  e.children.tags("IMG")(0).src = shortcutHot;            //<a> tags have an ID
  726.   
  727.   else if (e.className.toLowerCase()=="popup" && e.tagName=="IMG")  e.src = popupHot;            //<img> tags have a class
  728.   else if (e.className.toLowerCase()=="popupicon")  e.children.tags("IMG")(0).src = popupHot;            //<a> tags have an ID
  729.   
  730.   else if ((e.className.toLowerCase()=="expand" && e.tagName=="IMG") ||( e.id.toLowerCase()=="expand")) expandGoesHot(e);
  731.  
  732.  // Added to support Quad Method   **************************
  733.     if (e != null && e.firstChild != null && 
  734.         e.firstChild.tagName != null &&
  735.         e.firstChild.tagName.toLowerCase() == "input" && 
  736.         e.firstChild.type.toLowerCase() == "radio" && 
  737.         e.parentElement.className != "indentGray"){
  738.             QuadDocumentMouseOver()
  739.             }
  740.  
  741. // *****************************
  742. }
  743.  
  744. //*** gettingCold **************************************************************************************
  745. // Initial state for mouseout.
  746.  
  747. function gettingCold() {
  748. var e = window.event.srcElement;
  749.  
  750.  
  751.  
  752.   if (e.id.toLowerCase()=="hot")  e.id ="cold";
  753.   else if (e.src== previousHot)  e.src = previousCold;
  754.   else if (e.className.toLowerCase()=="navbar" && e.children.tags("IMG")(0).src== previousHot)  e.children.tags("IMG")(0).src= previousCold;
  755.   else if (e.src== nextHot)  e.src = nextCold;
  756.   else if (e.className.toLowerCase()=="navbar" && e.children.tags("IMG")(0).src== nextHot)  e.children.tags("IMG")(0).src= nextCold;
  757.   
  758.   else if (e.className.toLowerCase()=="shortcut" && e.tagName=="IMG")   e.src = shortcutCold;        //<img> tags have a class
  759.   else if (e.id.toLowerCase()=="shortcut")  e.children.tags("IMG")(0).src= shortcutCold;             //<a> tags have an ID
  760.   
  761.   else if (e.className.toLowerCase()=="popup" && e.tagName=="IMG")   e.src = popupCold;        //<img> tags have a class
  762.   else if (e.className.toLowerCase()=="popupicon")  e.children.tags("IMG")(0).src= popupCold;             //<a> tags have an ID
  763.   
  764.   else if ((e.className.toLowerCase()=="expand" && e.tagName=="IMG") ||( e.id.toLowerCase()=="expand")) expandGoesCold(e);
  765.   
  766.   // Added to support Quad Method   **************************
  767.     if (e != null && e.firstChild != null && 
  768.         e.firstChild.tagName != null &&
  769.         e.firstChild.tagName.toLowerCase() == "input" && 
  770.         e.firstChild.type.toLowerCase() == "radio" && 
  771.         e.parentElement.className != "indentGray"){
  772.             QuadDocumentMouseOver()
  773.             }
  774.  
  775. // *****************************
  776. }
  777.  
  778. //****************************************** OBJECT CONSTRUCTION **************************************
  779. //*****************************************************************************************************
  780. //  Uses an A tag to pass parameters between an HTML page and this script.
  781. //  Creates an ActiveX Object from these parameters, appends the Object to the end of the page,
  782. //  and clicks it. These objects relate to HTMLHelp environment and information about them can be found on the http://HTMLHelp site.
  783.  
  784. //  Object construction variables *********************************************************************
  785.  
  786. var sParamCHM,sParamFILE, sParamEXEC, sParamMETA,iEND;
  787. var sActX_HH= " type='application/x-oleobject' classid='clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11' ";
  788.  
  789.  
  790. //*** callPopup ***************************************************************************************
  791. // creates an object from an <A> tag HREF, the object inserts a winhelp popup
  792. // called by: <A ID="wPopup" HREF="HELP=@@file_name.hlp@@ TOPIC=@@topic#@@">@@Popup text@@</A>
  793.  
  794. var joker = false;
  795. var blague = true;
  796.  
  797. function callPopup(eventSrc) {
  798. if (popupOpen) closePopup();
  799. var ntsharedAdded= false;                    // make sure the object is only added once
  800. var CHMspecificAdded= false;                // make sure the object is only added once
  801. var coll = document.all.tags("SPAN");
  802. var sIndex,sText=" ",sFile,sFileID,dataBindingObject;
  803.  
  804.      var e= eventSrc;
  805.      var eH= unescape(e);
  806.      eH = eH.toLowerCase();
  807.      var eH_= eH.toLowerCase();
  808.      
  809.      if(event){
  810.          event.returnValue = false;
  811.         }
  812.      found = false;
  813.                                                        
  814.        var iTOPIC = eH.lastIndexOf("topic=");
  815.      if (iTOPIC==-1) return;
  816.      sParamTOPIC = eH.substring((iTOPIC+6),eH.length);
  817.      if (!isIE4){
  818.      if (!joejoe){
  819.         xmldom.load(moniker + path2glossary + "glossary.xml");
  820.         joejoe = true;
  821.         }
  822.          
  823.         var o=0;
  824.         var node = "";    
  825.         node = xmldom.selectSingleNode("glossary/glossSection/entry[@entryID='" + sParamTOPIC + "']");
  826.                     
  827.         if(node!=null)
  828.             {
  829.             
  830.             found = true;
  831.             var ralf = "";
  832.             ralf = node.getElementsByTagName("term")
  833.             sText = "<DIV CLASS='PopTerm'>" + ralf.item(0).nodeTypedValue + "</DIV>";
  834.             ralf = node.getElementsByTagName("para")
  835.             
  836.             if (ralf.length != 0){
  837.                 sText = sText + "<DIV CLASS='PopDef'>" + ralf.item(0).nodeTypedValue;
  838.                 sText = sText + "</DIV>";
  839.                 }
  840.             seealsos = node.getElementsByTagName("seeAlso");
  841.             var o=0;
  842.             
  843.             look_at = xmldom.getElementsByTagName("glossary/locSection/locItem[@locItemID = 'SeeAlso']");
  844.                         
  845.             while (o < seealsos.length){
  846.                 sIndex = seealsos.item(o).getAttribute("seeAlsoTermID");
  847.                 node = xmldom.selectSingleNode("glossary/glossSection/entry[@entryID='" + sIndex + "']");
  848.                 ralf = node.getElementsByTagName("term");
  849.                 sTerm = ralf.item(0).nodeTypedValue;
  850.                 if (o == 0) {
  851.                     sText = sText + "<DIV CLASS='PopSeeAlso'>" + look_at.item(0).nodeTypedValue + " "
  852.                     // sIndex = "<Input type=submit tabindex=1 value=hhhh onclick='jscript:alert(oPopup.sIndex.innerHTML)'>"
  853.                     sIndex = "<A ID='wPopup' HREF='HELP=glossary.hlp TOPIC=" + sIndex + "' bite_me='1'>" + sTerm + "</a>"
  854.                     }
  855.                 else
  856.                     {
  857.                     sIndex = ", <A ID='wPopup' HREF='HELP=glossary.hlp TOPIC=" + sIndex + "' bite_me='1'>" + sTerm + "</a>"
  858.                     }
  859.                 o++;
  860.                 sText = sText + sIndex 
  861.                 }
  862.                     
  863.             definition = xmldom.getElementsByTagName("glossary/locSection/locItem[@locItemID = 'See']");        
  864.             
  865.             seeentrys = node.getElementsByTagName("seeEntry");
  866.                             
  867.             while (o < seeentrys.length){
  868.                 sIndex = seeentrys.item(o).getAttribute("seeTermID");
  869.                 node = xmldom.selectSingleNode("glossary/glossSection/entry[@entryID='" + sIndex + "']");
  870.                 ralf = node.getElementsByTagName("term");
  871.                 sTerm = ralf.item(0).nodeTypedValue;
  872.                 if (o == 0) {
  873.                     sText = sText + "<DIV CLASS='PopSeeAlso'>" + definition.item(0).nodeTypedValue + " "
  874.                     // sIndex = "<Input type=submit tabindex=1 value=hhhh onclick='jscript:alert(oPopup.sIndex.innerHTML)'>"
  875.                     sIndex = "<A ID='wPopup' HREF='HELP=glossary.hlp TOPIC=" + sIndex + "' bite_me='1'>" + sTerm + "</a>"
  876.                     }
  877.                 else
  878.                     {
  879.                     sIndex = ", <A ID='wPopup' HREF='HELP=glossary.hlp TOPIC=" + sIndex + "' bite_me='1'>" + sTerm + "</a>"
  880.                     }
  881.                 o++;
  882.                 sText = sText + sIndex 
  883.                 }
  884.             }
  885.             
  886.             if (o != 0) sText = sText + "</DIV>" 
  887.              
  888.             if ((isIE55 || isIE6) && found){
  889.                 var oPopup = false
  890.                 var oPopup = window.createPopup();
  891.                  var strScript = "<script language='JScript'> function clickPopup(){if (event.srcElement.tagName.toLowerCase() == 'a') parent.callPopup(event.srcElement.href); window.PopObject.hide(); return false;}</script>";
  892.                   var strDoc = oPopup.document.body.outerHTML.toLowerCase()
  893.                 
  894.                   oPopup.document.write(strDoc.replace("></body>", " onclick=\"clickPopup()\">" + strScript + "</body>"));
  895.                 //oPopup.document.write(strDoc.replace("></body>", " onclick=\"clickPopup()\, onkeypress=\"process_closePopup()\">" + strScript + "</body>"));
  896.                     oPopup.document.createStyleSheet(sSharedCHM + "coUA.css");    // Apply the stylesheet.
  897.                 var oPopBody = oPopup.document.body;
  898.                 
  899.                 //oPopBody.style.backgroundColor = '#FFFFCC';
  900.                 
  901.                   // oPopBody.style.border = "solid black 1px";
  902.                   oPopBody.style.margin = "0 0 0 0";
  903.                 if (isRTL) oPopBody.innerHTML = "<SPAN DIR='RTL' class='XMLPopup'>" + sText + "</SPAN>"           // need to add the style class here.
  904.                 else oPopBody.innerHTML = "<SPAN class='XMLPopup'>" + sText + "</SPAN>"
  905.                     // alert(oPopBody.innerHTML)                
  906.                 if (window.event){
  907.                     joker = window.event.srcElement;
  908.                     }
  909.                 oPopup.show(0, 0, 400, 8, joker);    // Show the popup at an arbitrary size.
  910.                 var textSize = oPopBody.createTextRange();
  911.                 var wPop = textSize.boundingWidth + oPopBody.offsetWidth - oPopBody.clientWidth;    // Get the size of the text.
  912.                 var hPop = oPopBody.scrollHeight;
  913.                 oPopup.hide();
  914.                 oPopup.document.parentWindow.PopParent = window;
  915.                   oPopup.document.parentWindow.PopObject = oPopup;
  916.                 
  917.                   oPopup.show(0, 1, wPop , hPop, joker);
  918.                 //oPopup.document.focus(oPopup.document.body.JOKER);    
  919.                 return;
  920.                 }
  921.             
  922.             if (found){
  923.                 if (blague){
  924.                 document.body.insertAdjacentHTML("beforeEnd", "<DIV id='wPopupWeb' CLASS='popup'>" + sText + "</DIV>");
  925.                 blague = false;
  926.                 }
  927.                 window.wPopupWeb.innerHTML = sText;
  928.                 callPopupWeb(e);
  929.                 return;
  930.                 }
  931.             } // for support of IE4 disable xml popups
  932.                   
  933.    var iTOPIC = eH_.lastIndexOf("topic=");
  934.         if (iTOPIC==-1) return;
  935.         sParamTOPIC = eH.substring((iTOPIC+6),eH.length);          // extracts the topic for item2
  936.         
  937.   var iHELP = eH_.lastIndexOf("help=");
  938.         if (iHELP==-1) return;
  939.         sParamHELP = eH.substring(iHELP+5,iTOPIC);            // extracts the help file for item1
  940.         
  941.         if (document.hhPopup) document.hhPopup.outerHTML = "";    // if hhPopup object exists, clears it
  942.  
  943.  
  944.  var  h= "<object id='hhPopup'"+ sActX_HH + "STYLE='display:none'><param name='Command' value='WinHelp, Popup'>";
  945.       h= h + "<param name='Item1' value='" + sParamHELP + "'><param name='Item2' value='" + sParamTOPIC + "'></object>";
  946.         
  947.         document.body.insertAdjacentHTML("beforeEnd", h);     
  948.         document.hhPopup.hhclick();
  949. }
  950.  
  951.  
  952. //*** callAltLocation******************************************************************************
  953. // creates an object from an <A> tag HREF, the object will navigate to the alternate location if the first location is not found.
  954. // called from: <A ID="altLoc" HREF="CHM=@@1st_chm_name.chm;Alt_chm_name.chm@@  FILE=@@1st_file_name.htm;Alt_file_name.htm@@">@@Link text here@@</A>
  955.    
  956.  
  957. function callAltLocation(eventSrc) {
  958. var e= eventSrc;
  959. var eH= unescape(e.href);
  960. var eH_= eH.toLowerCase();
  961. var sFILEarray,sCHMarray;
  962.      event.returnValue = false;
  963.      
  964. // var sParamTXT= e.innerHTML;
  965. //      sParamTXT= sParamTXT.replace(semicolon,"");
  966.       
  967.    var sParamTXT= "";
  968.                                        
  969.   var iFILE = eH_.lastIndexOf("file=");
  970.         if (iFILE==-1) return;
  971.         sParamFILE= eH.substring((iFILE+5),eH.length);                  // extracts the 2 HTM files
  972.         sParamFILE= sParamFILE.replace(spaces,"");
  973.         iSPLIT= sParamFILE.match(semicolon);
  974.         if (iSPLIT)
  975.               sFILEarray = sParamFILE.split(";");                                        // separates the 2 HTM files
  976.         else return;
  977.           
  978.   var iCHM  = eH_.lastIndexOf("chm=");
  979.         if(iCHM==-1) return;
  980.         else         sParamCHM = eH.substring(iCHM+4,iFILE);            // extracts the 2 CHM's
  981.         sParamCHM= sParamCHM.replace(spaces,"");
  982.         iSPLIT= sParamCHM.match(semicolon);
  983.         if (iSPLIT)
  984.             sCHMarray= sParamCHM.split(";");                                    // separates the 2 CHM's
  985.         else return;
  986.         
  987.         sParamFILE= moniker + sCHMarray[0]+ "::/" + sFILEarray[0] + ";" + moniker + sCHMarray[1]+ "::/" + sFILEarray[1];
  988.                 
  989.         if (document.hhAlt) document.hhAlt.outerHTML = "";                // if hhAlt object exists, clears it
  990.  
  991.  
  992.   var h= "<object id='hhAlt'"+ sActX_HH + "STYLE='display:none'><PARAM NAME='Command' VALUE='Related Topics'>";
  993.       h= h + "<param name='Item1' value='" + sParamTXT +";" + sParamFILE + "'></object>";
  994.     
  995.         document.body.insertAdjacentHTML("beforeEnd", h); 
  996.         document.hhAlt.hhclick();
  997. }
  998.  
  999.  
  1000. //*** callRelatedTopics******************************************************************************
  1001. // creates an object from an <A> tag HREF, the object inserts a popup of the related topics to select
  1002. // called from: <A ID="relTopics" HREF="CHM=@@chm_name1.chm;chm_name2.chm@@ META=@@a_filename1;a_filename2@@">Related Topics</A>
  1003.    
  1004.  
  1005. function callRelatedTopics(eventSrc) {
  1006. var e= eventSrc;
  1007. var eH= unescape(e.href);
  1008. var eH_= eH.toLowerCase();
  1009.      event.returnValue = false;
  1010.                                        
  1011.   var iMETA = eH_.lastIndexOf("meta=");
  1012.         if (iMETA==-1) return;
  1013.         sParamMETA = eH.substring((iMETA+5),eH.length);              // extracts the META keywords for item2
  1014.         
  1015.   var iCHM  = eH_.lastIndexOf("chm=");
  1016.         if(iCHM==-1) sParamCHM = "";
  1017.         else         sParamCHM = eH.substring(iCHM+4,iMETA);            // extracts the CHM files for item1
  1018.     
  1019.         if (document.hhRel) document.hhRel.outerHTML = "";            // if hhRel object exists, clears it
  1020.  
  1021.  
  1022.   var h= "<object id='hhRel'"+ sActX_HH + "STYLE='display:none'><param name='Command' value='ALink,MENU'>";
  1023.       h= h + "<param name='Item1' value='" + sParamCHM + "'><param name='Item2' value='" + sParamMETA + "'></object>";
  1024.     
  1025.         document.body.insertAdjacentHTML("beforeEnd", h);     
  1026.         document.hhRel.hhclick();
  1027. }
  1028.  
  1029. //*** popNewWindow***************************************************************************************
  1030. // creates an object from an <A> tag HREF, the object then opens a new window from the image URL found in the HREF
  1031. // called from: <a id="thumbnail" title="Enlarge figure" href="CHM=NTArt.chm FILE=@@image_name.gif@@">@@alt text here@@</A>
  1032. // the thumbnail image is loaded by loadPage();
  1033.  
  1034.  
  1035. function popNewWindow(eventSrc) {
  1036. var eH= eventSrc.href;
  1037.       event.returnValue = false;
  1038.       
  1039.  // extracts the thumbnail image URL from the <a> tag HREF
  1040.     sParamFILE =  getURL(eH);
  1041.     if (sParamFILE=="") return;
  1042.     
  1043.     // sParamFILE = moniker + sParamFILE; 
  1044.     // sParamFILE = moniker + sParamFILE; 
  1045.     //alert(sParamFILE)
  1046.     // callThumbnailWeb(sParamFFILE)
  1047.     
  1048.        
  1049.  // if the hhWindow object exists, clears it
  1050.     if (document.hhWindow) document.hhWindow.outerHTML = "";        
  1051.         
  1052. var  h =  "<object id='hhWindow'"+ sActX_HH +" STYLE='display:none'><param name='Command' value='Related Topics'>";
  1053.      h = h + "<param name='Window' value='$global_largeart'><param name='Item1' value='$global_largeart;" + moniker + sParamFILE+ "'> </object>";
  1054.     
  1055.      document.body.insertAdjacentHTML("beforeEnd", h);
  1056.      document.hhWindow.hhclick();
  1057. }
  1058.  
  1059. //*** callShortcut ***************************************************************************************
  1060. // creates an object from an <A> tag, the object then calls the executable code
  1061. // called from: <A ID="shortcut" HREF="EXEC=@@executable_name.exe@@ CHM=ntshared.chm FILE=@@error_file_name.htm@@">@@Shortcut text@@</A>
  1062. // the shortcut image is loaded by loadInitialImg();
  1063.  
  1064. function callShortcut(eventSrc) { 
  1065. var e= eventSrc;
  1066. var eH= unescape(e.href);
  1067. var eH_= eH.toLowerCase();
  1068.  
  1069. event.returnValue = false;
  1070.               
  1071.  // extracts the error file URL from the <a> tag HREF
  1072. iEND= eH.length;
  1073. sParamFILE =  getURL(eH);
  1074.  
  1075. var iEXEC = eH_.lastIndexOf("exec="); 
  1076. var endstr = eH.lastIndexOf(",");
  1077. var sstr = eH.substring(endstr + 1, iEND);
  1078. var matchstr = "";
  1079. for(i=endstr + 1;i< iEND; i++)  //added 3/25/2002 by marissam to compensate for extra comma in shortcut calls in snippet
  1080.     matchstr = matchstr + " ";
  1081. if(sstr == matchstr)
  1082. {
  1083.     iEND = iEND - (iEND-endstr);
  1084. }
  1085.  
  1086.         if (iEXEC==-1) return;
  1087.         else sParamEXEC = eH.substring(iEXEC+5,iEND);    
  1088.         
  1089.        // alert("this is it-" + sParamEXEC + "-sParamExec");            // extracts the executable for item1
  1090.         if (document.hhShortcut) document.hhShortcut.outerHTML = "";            // if the hhShortcut object exists, clears it
  1091.     
  1092. var  h =  "<object id='hhShortcut'"+ sActX_HH +" STYLE='display:none'> <param name='Command' value='ShortCut'>";
  1093.      if(sParamFILE != "") h = h + "<param name='Window' value='" + moniker + sParamFILE+ "'>";
  1094.      h = h + "<param name='Item1' value='" + sParamEXEC + "'><param name='Item2' value='msg,1,1'></object>";
  1095.  
  1096.         document.body.insertAdjacentHTML("beforeEnd", h); 
  1097.         document.hhShortcut.hhclick();
  1098. }
  1099.  
  1100.  
  1101. //****************************************  EXPAND FUNCTIONS *********************************************************
  1102. //********************************************************************************************************************
  1103.  
  1104. //**  callExpand **************************************************************************************************
  1105. //  This expands & collapses (based on current state) "expandable" nodes as they are clicked.
  1106. //  Called by: <A ID="expand" href="#">@@Hot text@@</A>
  1107. //  Followed by:  <div class="expand">
  1108.  
  1109. function callExpand(eventSrc) {
  1110.  
  1111. var e= eventSrc;
  1112.     event.returnValue = false;                    // prevents navigating for <A> tag
  1113.     
  1114. var oExpandable = getExpandable(e); 
  1115. var oImg = getImage(e);
  1116.  
  1117.      if (oExpandable.style.display == "block")
  1118.           doCollapse(oExpandable, oImg);
  1119.      else doExpand(oExpandable, oImg);
  1120. }
  1121.  
  1122. //** expandGoesHot *********************************************************************************************
  1123. // Returns expand image to hot. 
  1124.  
  1125. function expandGoesHot(eventSrc){
  1126. var e= eventSrc;
  1127. //alert(e.outerHTML);
  1128. var oExpandable = getExpandable(e);
  1129.   
  1130. var oImg = getImage(e);
  1131. //alert (oImg.src)
  1132. if (oExpandable == false){
  1133.     plus_or_minus = oImg.src.indexOf("minus")
  1134.     if (plus_or_minus == -1){
  1135.         //alert(plus_or_minus)
  1136.         oImg.src = closedHot
  1137.         }
  1138.     else
  1139.         {
  1140.         oImg.src = expandHot;
  1141.         //alert(plus_or_minus)
  1142.         }
  1143.      return;
  1144.     }
  1145.  
  1146. if (!isIE4){
  1147.    if (oExpandable.style.display == "block"){
  1148.             oImg.src = expandHot;
  1149.          //alert(oImg.src)
  1150.          }
  1151.    else oImg.src = closedHot;
  1152. }
  1153. }
  1154.  
  1155.  
  1156. //** expandGoesCold *********************************************************************************************
  1157. // Returns expand image to cold.
  1158.  
  1159. function expandGoesCold(eventSrc){
  1160. var e= eventSrc;
  1161.  
  1162. var oExpandable = getExpandable(e);
  1163. var oImg = getImage(e);
  1164. // alert (oImg.src)
  1165.  
  1166. if (oExpandable == false){
  1167.     plus_or_minus = oImg.src.indexOf("minus")
  1168.     
  1169.     if (plus_or_minus == -1){
  1170.         //alert(plus_or_minus)
  1171.         oImg.src = closed
  1172.         }
  1173.     else
  1174.         {
  1175.         oImg.src = expand;
  1176.         //alert(plus_or_minus)
  1177.         }
  1178.      return;
  1179.     }
  1180.  
  1181.  
  1182. if (!isIE4){
  1183.  if (oExpandable.style.display == "block") oImg.src = expand;
  1184.   else oImg.src = closed;
  1185. }  
  1186. }
  1187.  
  1188.  
  1189. //** getExpandable *****************************[used by callExpand, expandGoesHot, expandGoesCold]*******
  1190. //  Determine if the element is an expandable node or a child of one.  
  1191.  
  1192. function getExpandable(eventSrc){
  1193. var  e = eventSrc;
  1194. var iNextTag, oExpandable;
  1195.     
  1196.        for (var i=1;i<4; i++){
  1197.                iNextTag=    e.sourceIndex+e.children.length+i;
  1198.               oExpandable= document.all(iNextTag);
  1199.               if (oExpandable.className.toLowerCase()=="expand" || iNextTag == document.all.length)
  1200.                   return oExpandable
  1201.                    break;
  1202.        }
  1203.        return false;
  1204.        
  1205. }
  1206.  
  1207. //**  getImage ***********************************[used by callExpand, expandGoesHot, expandGoesCold]*******
  1208. //  Find the first image in the children of the current srcElement.   
  1209. // (allows the  image to be placed anywhere inside the <A HREF> tag)
  1210.  
  1211. function getImage(header) {
  1212. var oImg = header;
  1213.  
  1214.        if(oImg.tagName != "IMG") oImg=oImg.children.tags("IMG")(0);
  1215.        return oImg;
  1216. }
  1217.  
  1218.  
  1219. //****  expandAll *******************************************************************************************************
  1220. //  Will expand or collapse all "expandable" nodes when clicked. [calls closeAll()]
  1221. //  called by: <A HREF="#" onclick="expandAll();">expand all</A>
  1222.  
  1223. var stateExpand = false;    //applies to the page 
  1224.  
  1225. //**** ****************************************************************************************************************
  1226.  
  1227. function expandAll() {
  1228. var oExpandToggle, oImg;
  1229. var expandAllMsg = "expand all";                    //message returned when CloseAll() is invoked
  1230. var closeAllMsg = "close all";                        //message returned when ExpandAll() is invoked
  1231. var e= window.event.srcElement;
  1232.        event.returnValue = false;
  1233.  
  1234.        for (var i=0; i< document.anchors.length; i++){
  1235.                oExpandToggle = document.anchors[i];
  1236.          
  1237.                 if (oExpandToggle.id.toLowerCase() == "expand"){ 
  1238.                      oExpandable = getExpandable(oExpandToggle);  
  1239.                      oImg = getImage(oExpandToggle);
  1240.              
  1241.                      if (stateExpand == true) doCollapse(oExpandable, oImg);
  1242.                      else                     doExpand(oExpandable, oImg);
  1243.                 }
  1244.        }
  1245.        if (stateExpand == true) {
  1246.             stateExpand = false;
  1247.             e.innerText= expandAllMsg;
  1248.        }
  1249.        else {
  1250.             stateExpand = true;
  1251.             e.innerText= closeAllMsg;
  1252.        }
  1253. }
  1254.  
  1255.  
  1256. //****  doExpand *******************************************************************************************************
  1257. //  Expands expandable block & changes image
  1258.     
  1259. var redo = false;    
  1260. function doExpand(oToExpand, oToChange) {
  1261. var oExpandable= oToExpand;
  1262. var oImg= oToChange;
  1263.  
  1264. //    if (printing == "TRUE") return;
  1265.  
  1266.     oImg.src = expand;
  1267.     oExpandable.style.display = "block";
  1268.     
  1269.     if (!redo && isIE4) {
  1270.         // alert("what")
  1271.         redo = true;
  1272.         // focus(oToExpand);
  1273.         doExpand(oToExpand, oToChange);
  1274.         }
  1275.     }
  1276.  
  1277.  
  1278. //****  doCollapse *****************************************************************************************************
  1279. //  Collapses expandable block & changes image
  1280.     
  1281. function doCollapse(oToCollapse, oToChange) {
  1282. // if (printing == "TRUE") return;
  1283. var oExpandable= oToCollapse;
  1284. var oImg= oToChange;
  1285.  
  1286.     oExpandable.style.display = "none";
  1287.     oImg.src = closed;
  1288. }
  1289.  
  1290. //*******************************************************************************************************
  1291. //******* WEB  FUNCTIONS **************************************************************************
  1292. //*******************************************************************************************************
  1293.  
  1294. //**** callThumbnailWeb **************************************************************************************
  1295.  
  1296. function callThumbnailWeb(eventSrc) {
  1297. var e= eventSrc;
  1298.        event.returnValue = false;
  1299.                     
  1300. var thumbnailWin= window.open (e.href, "height=450, width=600, left=10, top=10, dependent=yes, resizable=yes, status=no, directories=no, titlebar=no, toolbar=yes, menubar=no, location=no","true");
  1301.  
  1302. thumbnailWin.document.write ("<html><head><title>Windows 2000</title></head><body><img src='"+e.href+"'></body></html>");
  1303.  
  1304. return;
  1305. }
  1306.  
  1307. //*********************************************************************************************************
  1308. //*********************************************************************************************************
  1309.                                 
  1310. var popupOpen= false;                //state of popups
  1311. var posX, posY;                        //coordinates of popups
  1312. var oPopup;                            //object to be used as popup content
  1313.  
  1314. //**** callPopupWeb **************************************************************************************
  1315. // the web popups have been converted from the object winHelp popup for the web.
  1316. // called by: <A ID="wPopupWeb" HREF="#">@@Popup text@@</A>
  1317. // followed by: <div class="popup">Popup content</div>
  1318.  
  1319.  
  1320. function callPopupWeb(eventSrc) {
  1321. var e= eventSrc;
  1322.   
  1323.   // find the popup <div> that follows <a id="wPopupWeb"></a>
  1324.   findPopup(e);
  1325.   if (!e.bite_me) positionPopup(e)
  1326.  
  1327.   oPopup.style.visibility = "visible";
  1328.   // document.focus(e)
  1329.   popupOpen = true;
  1330.  
  1331.   return;
  1332. }
  1333.  
  1334. //**** findPopup ****************************************************************************************
  1335.  
  1336. function findPopup(oX){
  1337. var e= oX;
  1338. var iNextTag;
  1339.     
  1340.     for (var i=1;i<document.all.length; i++){
  1341.          iNextTag=    e.sourceIndex + i;
  1342.          oPopup= document.all(iNextTag);
  1343.          if (oPopup.className.toLowerCase()=="popup" || iNextTag == document.all.length)
  1344.              break;
  1345.     }
  1346.     
  1347.     if (iNextTag != document.all.length) {
  1348.         posX = window.event.clientX; 
  1349.         posY = window.event.clientY + document.body.scrollTop+10;
  1350.     }
  1351.     if (popupOpen) closePopup();
  1352. }
  1353.  
  1354.  
  1355. //****  positionPopup ************************************************************************************
  1356. // Set size and position of popup.
  1357. // If it is off the page, move up, but not past the very top of the page.
  1358.  
  1359. function positionPopup(oX){
  1360. var e= oX;    
  1361. var popupOffsetWidth = oPopup.offsetWidth;
  1362.  
  1363. //determine if popup will be offscreen to right
  1364. var rightlimit = posX + popupOffsetWidth;
  1365.  
  1366.   if (rightlimit >= document.body.clientWidth) 
  1367.       posX -= (rightlimit - document.body.clientWidth);
  1368.   if (posX < 0) posX = 0;
  1369.     
  1370. //position popup
  1371.   oPopup.style.top = posY;
  1372.   oPopup.style.left = posX;
  1373.  
  1374. var pageBottom = document.body.scrollTop + document.body.clientHeight;
  1375. var popupHeight = oPopup.offsetHeight;
  1376.   
  1377.   if (popupHeight + posY >= pageBottom) {
  1378.       if (popupHeight <= document.body.clientHeight)
  1379.           oPopup.style.top = pageBottom - popupHeight;
  1380.       else
  1381.            oPopup.style.top = document.body.scrollTop;
  1382.   }
  1383. }
  1384.  
  1385. //**** closePopup ****************************************************************************************
  1386. // Close Popup
  1387. function closePopup() {
  1388.  
  1389.   oPopup.style.visibility = "hidden";
  1390.   popupOpen = false;
  1391.   return;
  1392. }
  1393.  
  1394.  
  1395. //*********************************************  GENERAL FUNCTIONS ************************************************
  1396. //**************************************************************************************************************************
  1397.  
  1398. //***ajustImg *************************************************************************************************************
  1399. // expands an image to the with of the window or shrinks it to 90px
  1400.  
  1401. function ajustImg(eventSrc) {
  1402. var e= eventSrc;
  1403. var fullWidth= document.body.offsetWidth;
  1404.  
  1405.     fullWidth = fullWidth - 50;
  1406.     if (e.style.pixelWidth==90)
  1407.          e.style.pixelWidth=fullWidth;
  1408.     else e.style.pixelWidth=90;
  1409. }
  1410.  
  1411.  
  1412. //**  getURL **************************************[used in callShortcut, popNewWindow& loadPage]********
  1413. // extracts the file location (CHM::/HTM) URL 
  1414.  
  1415. function getURL(sHREF) {
  1416. var spaces= /\s/g
  1417. var eH = unescape(sHREF);
  1418.     eH = eH.replace(spaces,""); 
  1419.  
  1420. var eH_= eH.toLowerCase();
  1421. var sParamFILE= "";
  1422. var sParamCHM= "";
  1423.  
  1424. var iFILE= eH_.lastIndexOf("file=");
  1425.     if (iFILE!=-1){
  1426.         iEND= iFILE +1;
  1427.         sParamFILE = eH.substring(iFILE+5,eH.length);
  1428.     }
  1429.  
  1430. var iCHM  = eH_.lastIndexOf("chm=");
  1431.  
  1432. gifwithin = false; 
  1433. if (gifwithin){
  1434.     gifwithin = false;
  1435.     var con_mmc;
  1436.     var doc_mmc;
  1437.     doc_mmc = " " + document.location;
  1438.     doc_mmc = doc_mmc.toLowerCase();
  1439.     if (iCHM!=-1){
  1440.         iEND  = iCHM +1;                             // iEND used by callShortcut
  1441.         sParamCHM = eH.substring(iCHM+4, iFILE);
  1442.         con_mmc = doc_mmc.indexOf(sParamCHM);
  1443.             if (con_mmc != -1){
  1444.                 sParamCHM = "";
  1445.                 iCHM = -1;
  1446.             sParamFILE= sParamCHM+sParamFILE;    
  1447.             }
  1448.         }
  1449.     }
  1450.  
  1451.      if (iCHM!=-1){
  1452.         iEND  = iCHM +1;                             // iEND used by callShortcut
  1453.         sParamCHM = eH.substring(iCHM+4, iFILE);
  1454.         sParamFILE= sParamCHM+"::/"+sParamFILE;    
  1455.         }    
  1456.     return sParamFILE;
  1457. }
  1458. //****************************************************************************************************************************
  1459. //********************************************  IE5 PERSISTENCE  *************************************************************
  1460. //****************************************************************************************************************************
  1461.  
  1462. var oTD,iTD;         // persistence
  1463.  
  1464. //****** Persistence for userData ********************************************************************************************* 
  1465.  
  1466. function getChecklistState(){ 
  1467.  
  1468.  var pageID= addID();
  1469.  
  1470.     if (checklist.all== "[object]") {
  1471.     oTD=checklist.all.tags("INPUT");
  1472.     iTD= oTD.length;
  1473.         }
  1474.     else
  1475.         {
  1476.         printing = true;
  1477.         isPersistent = false;
  1478.         return;
  1479.         }
  1480.  
  1481.     if (iTD == 0){
  1482.         printing = true;
  1483.         isPersistent = false;
  1484.         return;
  1485.         }
  1486.     
  1487. // routine added to fix a bug in the ocx 06/14/99    
  1488.      lct = document.location + ".";
  1489.      xax = 10;
  1490.      xax = lct.indexOf("mk:@MSITStore");
  1491.      if (xax != -1) {
  1492.          lct = "ms-its:" + lct.substring(14,lct.length-1);
  1493.         // alert("before reload : " + document.location);
  1494.         // alert("replace with : " + lct);
  1495.         isPersistent = false;
  1496.         document.location.replace(lct);
  1497.         isPersistent = true;
  1498.         // alert("after reload : " + document.location);
  1499.         }     
  1500.      else
  1501.          {      
  1502.          checklist.load("oXMLStore");
  1503.         }
  1504. // routine added to fix a bug in the ocx 06/14/99
  1505.     if (checklist.getAttribute("sPersist"+pageID+"0"))    
  1506.     for (i=0; i<iTD; i++){
  1507.  
  1508.          if (oTD[i].type =="checkbox" || oTD[i].type =="radio"){
  1509.          checkboxValue= checklist.getAttribute("sPersist"+pageID+i);
  1510.         
  1511.          if (checkboxValue=="yes") oTD[i].checked=true;
  1512.          else oTD[i].checked=false;
  1513.          }// if
  1514.          if (oTD[i].type =="text")              
  1515.               oTD[i].value= checklist.getAttribute("sPersist"+pageID+i);
  1516.      }// for
  1517. } // end persistence
  1518.  
  1519. //**  saveChecklistState *************************************************************************************************************
  1520. function saveChecklistState(){
  1521. var pageID= addID(); 
  1522.  
  1523.         if (!isPersistent) return; 
  1524.          //  you will need this           document.location
  1525.         for (i=0; i<iTD; i++){
  1526.  
  1527.                 if (oTD[i].type =="checkbox" || oTD[i].type =="radio"){
  1528.                  if (oTD[i].checked) checkboxValue="yes";
  1529.                  else checkboxValue="no";
  1530.                  
  1531.                  checklist.setAttribute("sPersist"+pageID+i, checkboxValue);
  1532.              }// if
  1533.             
  1534.               if (oTD[i].type =="text") 
  1535.                  checklist.setAttribute("sPersist"+pageID+i, oTD[i].value);
  1536.          }    // for
  1537.  
  1538.  // routine added to fix a bug in the ocx 06/14/99    
  1539.      lct = document.location + ".";
  1540.      xax = 10;
  1541.      xax = lct.indexOf("mk:@MSITStore");
  1542.      if (xax != -1) {
  1543.          lct = "ms-its:" + lct.substring(14,lct.length-1);
  1544.         // alert("before reload : " + document.location);
  1545.         // alert("replace with : " + lct);
  1546.         isPersistent = false;
  1547.         document.location.replace(lct);
  1548.         isPersistent = true;
  1549.         // alert("after reload : " + document.location);
  1550.         }     
  1551.      else
  1552.          {      
  1553.          checklist.save("oXMLStore");
  1554.         }
  1555. // routine added to fix a bug in the ocx 06/14/99
  1556.      
  1557. }//end function
  1558.  
  1559. //**  resizeDiv *******************************[used with callPopupWeb, setPreviousNext}****************************************************
  1560. //  resize the page when the <div class=nav></div> && <div class=text></div> are found
  1561. function resizeDiv(){
  1562. if (printing == true) return;
  1563. var oNav = document.all.item("nav");
  1564. var oText= document.all.item("text");
  1565.  
  1566.     if (popupOpen) closePopup();
  1567.     if (oText == null) return;
  1568.     if (oNav != null){
  1569.         document.all.nav.style.width= document.body.offsetWidth;
  1570.         document.all.text.style.width= document.body.offsetWidth-4;
  1571.         document.all.text.style.top= document.all.nav.offsetHeight;
  1572.         if (document.body.offsetHeight > document.all.nav.offsetHeight)
  1573.             document.all.text.style.height= document.body.offsetHeight - document.all.nav.offsetHeight;
  1574.          else document.all.text.style.height=0; 
  1575.   }
  1576. }
  1577. //**  addID *************************************************************************************************************
  1578. function addID(){
  1579.  
  1580. var locID = document.location.href; 
  1581. var iHTM = locID.lastIndexOf(".htm");
  1582. var iName=locID.lastIndexOf("/");
  1583.       locID = locID.substring(iName+1,iHTM);
  1584.     
  1585.     return locID;
  1586. }    
  1587. //** set_to_print ***************
  1588. function set_to_print(){
  1589.     // alert(printing)
  1590.     if (printing == true) return
  1591.     var i;
  1592.     
  1593.  
  1594. var isIE5 = (navigator.appVersion.indexOf("MSIE 5")>0) || (navigator.appVersion.indexOf("MSIE")>0 && parseInt(navigator.appVersion)> 4);
  1595. var isIE55 = (navigator.appVersion.indexOf("MSIE 5.5")>0);
  1596. if (isIE5 && isIE55) isIE5 = false;
  1597. var isIE6 = (navigator.appVersion.indexOf("MSIE 6")>0);
  1598. var isIE4 = (navigator.appVersion.indexOf("MSIE 4")>0);
  1599.  
  1600. if (!isIE5 && !isIE55 && !isIE4 && !isIE6) {
  1601.     isIE6 = true;
  1602.     }
  1603.  
  1604.  
  1605. // trying    
  1606.  
  1607. printing = true;
  1608.  
  1609.  if (isIE55){
  1610.      addReusableText();
  1611.      insertImages_4_print();
  1612.      }
  1613. if (isIE6){
  1614.     addReusableText();
  1615.      insertImages_4_print();
  1616.     }
  1617.  
  1618. // to fix printing
  1619.  
  1620.  
  1621.  
  1622. isPersistent= (document.all.item("checklist")!=null) && ((isIE5) || (isIE6) || (isIE55));
  1623.  setPreviousNext();
  1624.  resizeDiv();
  1625. // if (isPersistent) getChecklistState();
  1626.  
  1627.  
  1628.     if (window.text) {
  1629.         if (!window.text.style){
  1630.             scroller = "FALSE";
  1631.             }
  1632.         else
  1633.             {
  1634.             document.all.text.style.height = "auto";
  1635.             scroller = "TRUE";
  1636.             }
  1637.         }
  1638.     
  1639. var thisLoc= document.location.href;
  1640.     thisLoc = thisLoc.indexOf("glossary.htm")
  1641.     if (thisLoc != -1){
  1642.         return;
  1643.         }
  1644.     // alert("in print")
  1645.     
  1646.     // alert(isIE6)
  1647.     for (i=0; i < document.all.length; i++){
  1648.         if (document.all[i].id == "expand") {
  1649.             // callExpand(document.all[i]);         // no longer needed since the coua_print.css does this now.
  1650.             single = "TRUE";
  1651.             }
  1652.         if (document.all[i].tagName == "BODY") {
  1653.             document.all[i].scroll = "auto";
  1654.             }
  1655.         if (document.all[i].tagName == "A" && scroller != "TRUE") {
  1656.             joe = " " + document.all[i].outerHTML
  1657.             joe = joe.toLowerCase();
  1658.             joe = joe.indexOf("href=")
  1659.             if(joe == -1){
  1660.                 document.all[i].outerHTML = "<A NAME=''>" + document.all[i].innerHTML + "</a>";
  1661.                 }
  1662.             else
  1663.                 {
  1664.                 document.all[i].outerHTML = "<A HREF=''>" + document.all[i].innerHTML + "</a>";
  1665.                 }
  1666.             }
  1667.         }
  1668.         
  1669. // reset_form();
  1670.     
  1671. }
  1672. //** used to reset a page if needed ********************
  1673. function reset_form(){
  1674.     printing = false;
  1675.     document.location.reload();
  1676. }
  1677.  
  1678.     
  1679. //** on error routine *********************************
  1680. function errorHandler() {
  1681.  //  alert("Error Handled");
  1682.   return true;
  1683. }
  1684.  
  1685. // ******************************* this function is to help ie55 and ie6 to print these images  ******
  1686. booking = false;
  1687. function insertImages_4_print(){
  1688.  
  1689. window.onerror = errorHandler
  1690. // if (isIE6) return
  1691. // if (isIE55) return
  1692. if (!printing) booking = true;
  1693. if (printing == true && booking == true ) {
  1694.     booking = false;
  1695.     return;
  1696.     }
  1697.  
  1698.  
  1699.  var collP = document.all.tags("P");
  1700.   
  1701.   for (var i=0; i<collP.length; i++) {
  1702.        if (collP[i].className.toLowerCase()=="note")            collP[i].innerHTML ="<img class='alert' src='"+noteImg+"' "+ imgStyleRTL +"> " +     collP[i].innerHTML;
  1703.        else if (collP[i].className.toLowerCase()=="warning")    collP[i].innerHTML ="<img class='alert' src='"+warningImg+"'> " +  collP[i].innerHTML;
  1704.        else if (collP[i].className.toLowerCase()=="caution")    collP[i].innerHTML ="<img class='alert' src='"+cautionImg+"'> " +  collP[i].innerHTML;
  1705.        else if (collP[i].className.toLowerCase()=="tip")        collP[i].innerHTML ="<img class='alert' src='"+tipImg+"'> " +      collP[i].innerHTML;
  1706.        else if (collP[i].className.toLowerCase()=="important")  collP[i].innerHTML ="<img class='alert' src='"+importantImg+"'> " + collP[i].innerHTML;
  1707.        else if (collP[i].className.toLowerCase()=="empty")      collP[i].innerHTML ="<img class='alert' src='"+emptyImg+"'> " +    collP[i].innerHTML;
  1708.        if (collP[i].className.toLowerCase()=="reltopics" && rel_gif == "yes")  {
  1709.             collP[i].outerHTML ="<img class='relTopics' src='"+relTopicsImg+"'> " + collP[i].outerHTML;
  1710.             }   
  1711.           }
  1712.   
  1713. //alert(printing)
  1714. //alert(isIE55)
  1715. //indents for Navigation Tree 
  1716. var collUL = document.all.tags("UL");
  1717. if (!printing) {
  1718. for (var i=0; i<collUL.length; i++) {
  1719.        var indent= 0;
  1720.        if (collUL[i].className.toLowerCase()=="navtree"){
  1721.            if (isRTL) collUL[i].style.listStyleImage= "url('" + branchImg_RTL + "')";
  1722.            else collUL[i].style.listStyleImage= "url('" + branchImg + "')";
  1723.              for (var j = 0; j < collUL[i].children.length; j++)
  1724.                 if (collUL[i].children[j].className.toLowerCase()=="branch"){
  1725.                     if (isRTL) collUL[i].children[j].style.marginRight= (indent +'em');
  1726.                     else   collUL[i].children[j].style.marginLeft= (indent +'em');
  1727.                     indent= indent + 0.75;
  1728.                 }
  1729.       }
  1730. }
  1731. }
  1732.    
  1733.   for (var i=0; i < document.anchors.length; i++){
  1734.          var imgInsert="";  
  1735.          var imgStyle= "";
  1736.          var imgSpace= "<span class='space'></span>";      
  1737.          var oBefore=document.anchors[i].parentElement.tagName;
  1738.          var oAnchor= document.anchors[i].id.toLowerCase();
  1739.          
  1740. // insert RELTOPICS icons
  1741.     if (rel_gif == "yes"){
  1742.        if (oAnchor=="reltopics")
  1743.                if (document.anchors[i].children.tags("IMG")(0) && document.anchors[i].children.tags("IMG")(0).className.toLowerCase() == "reltopics")
  1744.                     imgInsert= "";    // not to re-insert when persistent
  1745.             else  imgInsert= "<img class='relTopics' src='"+relTopicsImg+"'>" + imgSpace;
  1746.         }
  1747.         
  1748. // insert SHORTCUT icons
  1749.        if (oAnchor=="shortcut") {    
  1750.             document.anchors[i].title= sShortcutTip;     
  1751.             if (document.anchors[i].children.tags("IMG")(0) && document.anchors[i].children.tags("IMG")(0).className.toLowerCase() == "shortcut")
  1752.                     imgInsert= "";    // not to re-insert when persistent
  1753.             else  imgInsert= "<img class='shortcut' src='"+shortcutCold+"' "+ imgStyleRTL+ ">" + imgSpace;
  1754.         }    
  1755.                       
  1756. // insert POPUP icons
  1757.        else if (oAnchor=="wpopup" || oAnchor=="wpopupweb") document.anchors[i].title= sPopupTip;
  1758.        else if (document.anchors[i].className.toLowerCase()=="popupicon")
  1759.             if (document.anchors[i].children.tags("IMG")(0) && document.anchors[i].children.tags("IMG")(0).className.toLowerCase() == "popup")
  1760.                    imgInsert= "";    // not to re-insert when persistent
  1761.             else imgInsert= "<img class='popup' src='"+popupCold+"'>" + imgSpace;
  1762.  
  1763. // insert EXPAND icons 
  1764.        else if (oAnchor=="expand") {
  1765.               document.anchors[i].title= sExpandTip;
  1766.               if (document.anchors[i].children.tags("IMG")(0) && document.anchors[i].children.tags("IMG")(0).className.toLowerCase() == "expand")
  1767.                   imgInsert= "";     // not to re-insert when persistent      
  1768.               else{ 
  1769.                   if (document.anchors[i].parentElement.offsetLeft == document.anchors[i].offsetLeft) {
  1770.                       imgSpace= "<span class='space' style='width:0'></span>";     
  1771.                       if (isRTL){ document.anchors[i].parentElement.style.marginRight= "1.5em";  imgStyle=" style=margin-right:'-1.5em'";}
  1772.                       else { document.anchors[i].parentElement.style.marginLeft= "1.5em";  imgStyle=" style=margin-left:'-1.5em'";}
  1773.                   }      
  1774.                   imgInsert= "<img class='expand' src='"+ closed +"' "+imgStyle+">" +imgSpace;
  1775.               }
  1776.        }
  1777.  
  1778.  
  1779.  
  1780. // insert thumbnail images       
  1781.        else if (oAnchor=="thumbnail"  || oAnchor=="thumbnailweb"){ 
  1782.             var sAltText = document.anchors[i].innerHTML;
  1783.             gifwithin = true;
  1784.             var sThumbnailText = document.anchors[i].title; 
  1785.             var oImg = document.anchors[i].href.toLowerCase();
  1786.                   if (oAnchor=="thumbnail") 
  1787.                          var sThumbnailImg= moniker + getURL(oImg);
  1788.                   else var sThumbnailImg = document.anchors[i].href.toLowerCase();
  1789.                   
  1790.                  found = sAltText.indexOf("BACKGROUND-COLOR:")
  1791.             if (found != -1) {
  1792.                 stop_p = sAltText.indexOf(">");
  1793.                 sAltText = sAltText.substring(stop_p + 1, sAltText.length);
  1794.                 stop_p = sAltText.indexOf("</FONT>");
  1795.                 Highlighted = sAltText.substring(0,stop_p)
  1796.                 sAltText = Highlighted + sAltText.substring(stop_p + 7, sAltText.length);
  1797.                 }
  1798.  
  1799.                   
  1800.                 document.anchors[i].outerHTML = "<DIV id='thumbDiv' class='thumbnail'>"+document.anchors[i].outerHTML+"</div>";
  1801.                 document.anchors[i].innerHTML = "<img class='thumbnail' src='" + sThumbnailImg + "' alt= ' " + sAltText + "'><p>" +sThumbnailText+"</p>";
  1802.                 
  1803.                   if (isRTL) thumbDiv.style.styleFloat= "right";
  1804.            }
  1805.            
  1806.         
  1807.         
  1808.         document.anchors[i].innerHTML = imgInsert + document.anchors[i].innerHTML;
  1809.        if (isRTL) document.anchors[i].dir="rtl";
  1810.    }
  1811. }
  1812.  
  1813. //** quad method code --  Witten by Randy Feinger, morphed to work inside of shared.js
  1814. function QuadDocumentMouseOver()
  1815. {
  1816.     var elem = event.srcElement;
  1817.     
  1818.     // If the first childe of the source element is a radio button and 
  1819.     // the parent element isn't grayed, change the cursor to a hand
  1820.     // or back to the original as appropriate.
  1821.     if (elem != null && elem.firstChild != null && 
  1822.         elem.firstChild.tagName != null &&
  1823.         elem.firstChild.tagName.toLowerCase() == "input" && 
  1824.         elem.firstChild.type.toLowerCase() == "radio" && 
  1825.         elem.parentElement.className != "indentGray")
  1826.     {
  1827.         if (elem.style.cursor == "hand")
  1828.             elem.style.cursor = "auto";
  1829.         else
  1830.             elem.style.cursor = "hand";
  1831.     }
  1832. }
  1833.  
  1834. function QuadDocumentClick()
  1835. {
  1836.     // Don't process clicks on grayed text.
  1837.     if (event.srcElement.parentElement.className == "indentGray")
  1838.         return;
  1839.     
  1840.     // INPUT elements should be wrapped by another element such as a SPAN, DIV, or P.
  1841.     var elem = event.srcElement.firstChild;
  1842.     
  1843.     // If this is a radio button...
  1844.     if (elem != null && elem.tagName != null && elem.tagName.toLowerCase() == "input" && elem.type == "radio")
  1845.     {
  1846.         // check it.
  1847.         elem.checked = true;
  1848.     }
  1849.     else
  1850.     {    
  1851.         // Otherwise, set elem to the event's source element.
  1852.         elem = event.srcElement;
  1853.     }
  1854.     
  1855.     // Call OnElementClick() and pass in the source element, and the name token
  1856.     // used to mark a top-level clickable element such as a radio button.
  1857.     OnElementClick(elem, "row1");
  1858. }
  1859.  
  1860.  
  1861.  
  1862. function OnElementClick(srcElem, token)
  1863. {
  1864.     var elemTagName = srcElem.tagName;                        // Tag name of the source element.
  1865.     var collElements1 = document.all.item(srcElem.name);    // Collection of elements with the same name property as the source element.
  1866.     var n = srcElem.sourceIndex;                            // The source index of the source element.
  1867.     var elemGroup = srcElem.group;                            // The (dynamic) group property for the source element.
  1868.     var elemID = srcElem.id;                                // The source element's ID.
  1869.     var i, j, k;                                            // Loop variables.
  1870.     
  1871.     // If there are no elements with the same name as the source element, or
  1872.     // if the source element isn't part of a group, exit the function.
  1873.     if (collElements1 == null || elemGroup == null || collElements1.length == null)
  1874.         return;
  1875.     
  1876.     // Make sure the source element's name contains the designated token
  1877.     // so we know it's top-level element that should be processed.
  1878.     if (srcElem.name.toLowerCase().indexOf(token) != -1)
  1879.     {
  1880.         // Loop through the collection of 
  1881.         for (i = 0; i < collElements1.length; i++)
  1882.         {
  1883.             // Go up one level and then down a level in the element hierarchy to find
  1884.             // the container (parent) element for the clickable sub-elements (radio buttons).
  1885.             var oNextElement = collElements1(i).parentElement.nextSibling;
  1886.             
  1887.             // If there is no such element, get the next element in the collection.
  1888.             if (oNextElement == null || oNextElement.tagName == null)
  1889.                 continue;
  1890.             
  1891.             // Get the collection of all the elements within the container element that 
  1892.             // have the same tag name as the source element.
  1893.             var collElements2 = oNextElement.all.tags(elemTagName);
  1894.             
  1895.             // Make sure the collection is valid.
  1896.             if (collElements2 == null || collElements2.length == 0)
  1897.                 continue;
  1898.  
  1899.             // Loop through the collection of sub-elements within the container element.
  1900.             for (j = 0; j < collElements2.length; j++)
  1901.             {
  1902.                 // If the current element in the collection is not the
  1903.                 // source element, disable it and make the text gray.
  1904.                 if (collElements1(i).sourceIndex != n)
  1905.                 {
  1906.                     oNextElement.className = "indentGray"
  1907.                     collElements2(j).disabled = true;
  1908.                 }
  1909.                 else    // Otherwise, enable the element and make the text black.
  1910.                 {
  1911.                     oNextElement.className = "indentBlack"
  1912.                     collElements2(j).disabled = false;
  1913.                     
  1914.                     // Set the ID for the checked (selected) element for use below.
  1915.                     if (collElements2(j).tagName.toLowerCase() == "input" && 
  1916.                         collElements2(j).type.toLowerCase() == "radio" && 
  1917.                         collElements2(j).checked == true)
  1918.                     {
  1919.                         elemID = collElements2(j).id;
  1920.                     }
  1921.                 }
  1922.             }
  1923.         }
  1924.     }
  1925.     
  1926.     // Get the collection of all of the elements with the same tag name as that
  1927.     // of the source element.
  1928.     var collElements2 = document.all.tags(elemTagName);
  1929.         
  1930.     // Make sure the collection is valid.
  1931.     if (collElements2 == null || collElements2.length == 0)
  1932.         return;
  1933.         
  1934.     // Loop through the collection of elements.
  1935.     for (i = 0; i < collElements2.length; i++)
  1936.     {
  1937.         // Get the collection of all elements with the same ID as the
  1938.         // current item in the collection.
  1939.         var collAssocElems = document.all(collElements2(i).id);
  1940.                 
  1941.         // Make sure the collection is valid.
  1942.         if (collAssocElems == null || collAssocElems.length == 0)
  1943.             continue;
  1944.             
  1945.         // Loop through the collection of same-named elements.
  1946.         for (j = 0; j < collAssocElems.length; j++)
  1947.         {
  1948.             // If the tag name for the current element is different than that for the source element,
  1949.             // and the current element is part of the same group as the source element, 
  1950.             // hide or display the element as appropriate.
  1951.             if (collAssocElems(j).tagName != elemTagName && collAssocElems(j).group == elemGroup)
  1952.             {
  1953.                 // Hide the element unless the current element's ID matches the ID of the element
  1954.                 // that has been checked (selected).
  1955.                 collAssocElems(j).style.display = ((collAssocElems(j).id == elemID) ? "block" : "none")
  1956.             }
  1957.         }
  1958.     }
  1959. }
  1960.  
  1961.